package com.igame.mapper;

import com.github.pagehelper.Page;
import com.igame.dto.InformationPageDto;
import com.igame.entity.Information;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface InformationMapper {
    @Insert("insert into information(id, title, content, create_user, create_time,image) VALUES (#{id},#{title},#{content},#{createUser},#{createTime},#{image})")
    int insert(Information information);

    @Select("select * from information order by create_time desc")
    Page<Information> pageQuery(InformationPageDto dto);

    @Select("SELECT * from information where id =#{id}")
    Information selectInformationById(Integer id);
}
